package com.wswy.wyjk.ui.uitls

import android.graphics.drawable.Drawable
import android.graphics.drawable.StateListDrawable
import android.support.v4.content.ContextCompat
import com.raft.framework.utils.UICompat
import com.wswy.wyjk.AppContext
import com.wswy.wyjk.R
import com.wswy.wyjk.ui.drawable.OptionDrawable

object OptionUtils{



    fun createOptionDrawable(option:String):Drawable{

        val drawable = StateListDrawable()

        drawable.setBounds(0,0,UICompat.dp2px(24),UICompat.dp2px(24))

        drawable.addState(intArrayOf(android.R.attr.state_activated),OptionDrawable(option,true))

        //drawable.addState(intArrayOf(-android.R.attr.state_checked),OptionDrawable(option,false))

        drawable.addState(intArrayOf(android.R.attr.state_selected),ContextCompat.getDrawable(AppContext.getContext(),
            R.drawable.answer_right))

        //drawable.addState(intArrayOf(-android.R.attr.state_selected),OptionDrawable(option,false))

        drawable.addState(intArrayOf(),OptionDrawable(option,false))


        return drawable
    }




}